package com.demo.jpa.dao.repository;

import com.demo.jpa.dao.entity.RoleEntity;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @Author:LiaoYouLe
 * @Date: Created in 2018/7/27
 * @Description
 * @Modifyied By:
 */
public interface RoleRepository extends JpaRepository<RoleEntity, Integer> {
    @Override
    List<RoleEntity> findAll();
    @EntityGraph(value = "RoleEntity.privileges",type = EntityGraph.EntityGraphType.LOAD)
    List<RoleEntity> findDistinctByRidNotNull();
}
